#include "../include/format.hpp"
#include <cassert>

using namespace easylog;

void test01()
{
    formatter fmtr("[%d{%F %H:%M:%S}][%p][%t][%c][%f:%l]%T%m [%a]%n");

    message msg(level::lv_enum::info, __FILE__, __LINE__, __FUNCTION__, "logger1", "I get a message");
    std::cout << fmtr.format(std::forward<message>(msg)) << std::endl;
}

void test02()
{
    formatter fmtr;
    fmtr.set_pattern("%d{%F %H:%M:%S} %p %t %c %f:%l %T%m - %a%n");
    message msg(level::lv_enum::info, __FILE__, __LINE__, __FUNCTION__, "logger2", "I get a message");
    std::cout << fmtr.format(std::forward<message>(msg)) << std::endl;
}

#define TEST \
                2

int main()
{
    switch (TEST)
    {
    case 1: test01(); break;
    case 2: test02(); break;
    default: assert(false);
    }

    return 0;
}
